import { debounce } from './util'
import BackTop from 'components/content/backTop/BackTop'
export const itemListenerMixin = {
    components: {

    },
    methods: {

    },
    data() {
        return {
            itemImageListener: null,
            scrollRefresh: null
        }
    },
    mounted() {
        this.scrollRefresh = debounce(this.$refs.scroll.refresh, 500)

        this.itemImageListener = () => {
            this.scrollRefresh()
        }

        this.$bus.$on('itemImageLoad', this.itemImageListener)
    },
}

export const backTopMixin = {
    components: {
        BackTop
    },
    data() {
        return {
            isShowBackTop: false,
        }
    },
    methods: {
        backClick() { //回到顶部
            this.$refs.scroll.scrollToTop(0, 0)
        },
    },
}